import request from '@/utils/request'
import qs from 'qs'

// 查询项目成员
export function getProjectMemberData(params) {
  return request({
    url: 'api/projectMember' + '?' + qs.stringify(params, { indices: false }),
    method: 'get'
  })
}

// 资源初始化
export function initProjectMember(params) {
  return request({
    url: 'api/projectMember/init',
    method: 'get',
    params
  })
}

// 保存项目成员
export function add(data) {
  return request({
    url: 'api/projectMember/save',
    method: 'put',
    data
  })
}

// 资源继承
export function inheritProjectMember(params) {
  return request({
    url: 'api/projectMember/inherit',
    method: 'get',
    params
  })
}

// 批量添加资源
export function batchProjectMember(data) {
  return request({
    url: 'api/projectMember/batch',
    method: 'post',
    data
  })
}

export default { getProjectMemberData, initProjectMember, add, inheritProjectMember, batchProjectMember }
